#include <iostream>
#include <string>
#include <algorithm>
#include <cctype>
#include <cstdio>
using namespace std;

int main()
{
    string x, in;
    cin >> x;
    getchar();
    getline(cin, in);
    transform(x.begin(), x.end(), x.begin(), ::tolower);
    transform(in.begin(), in.end(), in.begin(), ::tolower);
    size_t pos = 0, first;
    int cnt = 0;
    bool flg = false;

    while ((pos = in.find(x, pos)) != string::npos)
    {
        if  (
                (pos==0 || in[pos-1]==' ')
                && (pos+x.length()-1==in.length()-1 || in[pos+x.length()]==' ')
            ){
            ++cnt;
            if(!flg) {first = pos; flg = true;}
        }
        pos++;

    }
    if(cnt == 0) cout << -1;
    else cout << cnt << " " << first;
    return 0;
}
